home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / gfx / x11 / x3270_3_2_16.lha / amiga_src / tn3270e.h < prev    next >
Text File  |  2009-02-26  |  2KB  |  81 lines

  1. /*
  2.  * Copyright 1996, 1999 by Paul Mattes.
  3.  *  Permission to use, copy, modify, and distribute this software and its
  4.  *  documentation for any purpose and without fee is hereby granted,
  5.  *  provided that the above copyright notice appear in all copies and that
  6.  *  both that copyright notice and this permission notice appear in
  7.  *  supporting documentation.
  8.  */
  9.  
  10. /*
  11.  *    tn3270e.h
  12.  *
  13.  *        Header file for the TN3270E Protocol, RFC 2355.
  14.  */
  15.  
  16. /* Negotiation operations. */
  17. #define TN3270E_OP_ASSOCIATE        0
  18. #define TN3270E_OP_CONNECT        1
  19. #define TN3270E_OP_DEVICE_TYPE        2
  20. #define TN3270E_OP_FUNCTIONS        3
  21. #define TN3270E_OP_IS            4
  22. #define TN3270E_OP_REASON        5
  23. #define TN3270E_OP_REJECT        6
  24. #define TN3270E_OP_REQUEST        7
  25. #define TN3270E_OP_SEND            8
  26.  
  27. /* Negotiation reason-codes. */
  28. #define TN3270E_REASON_CONN_PARTNER    0
  29. #define TN3270E_REASON_DEVICE_IN_USE    1
  30. #define TN3270E_REASON_INV_ASSOCIATE    2
  31. #define TN3270E_REASON_INV_DEVICE_NAME    3
  32. #define TN3270E_REASON_INV_DEVICE_TYPE    4
  33. #define TN3270E_REASON_TYPE_NAME_ERROR    5
  34. #define TN3270E_REASON_UNKNOWN_ERROR    6
  35. #define TN3270E_REASON_UNSUPPORTED_REQ    7
  36.  
  37. /* Negotiation function Names. */
  38. #define TN3270E_FUNC_BIND_IMAGE        0
  39. #define TN3270E_FUNC_DATA_STREAM_CTL    1
  40. #define TN3270E_FUNC_RESPONSES        2
  41. #define TN3270E_FUNC_SCS_CTL_CODES    3
  42. #define TN3270E_FUNC_SYSREQ        4
  43.  
  44. /* Header data type names. */
  45. #define TN3270E_DT_3270_DATA        0x00
  46. #define TN3270E_DT_SCS_DATA        0x01
  47. #define TN3270E_DT_RESPONSE        0x02
  48. #define TN3270E_DT_BIND_IMAGE        0x03
  49. #define TN3270E_DT_UNBIND        0x04
  50. #define TN3270E_DT_NVT_DATA        0x05
  51. #define TN3270E_DT_REQUEST        0x06
  52. #define TN3270E_DT_SSCP_LU_DATA        0x07
  53. #define TN3270E_DT_PRINT_EOJ        0x08
  54.  
  55. /* Header request flags. */
  56. #define TN3270E_RQF_ERR_COND_CLEARED    0x00
  57.  
  58. /* Header response flags. */
  59. #define TN3270E_RSF_NO_RESPONSE        0x00
  60. #define TN3270E_RSF_ERROR_RESPONSE    0x01
  61. #define TN3270E_RSF_ALWAYS_RESPONSE    0x02
  62. #define TN3270E_RSF_POSITIVE_RESPONSE    0x00
  63. #define TN3270E_RSF_NEGATIVE_RESPONSE    0x01
  64.  
  65. /* Header response data. */
  66. #define TN3270E_POS_DEVICE_END        0x00
  67. #define TN3270E_NEG_COMMAND_REJECT    0x00
  68. #define TN3270E_NEG_INTERVENTION_REQUIRED 0x01
  69. #define TN3270E_NEG_OPERATION_CHECK    0x02
  70. #define TN3270E_NEG_COMPONENT_DISCONNECTED 0x03
  71.  
  72. /* TN3270E data header. */
  73. typedef struct {
  74.     unsigned char data_type;
  75.     unsigned char request_flag;
  76.     unsigned char response_flag;
  77.     unsigned char seq_number[2]; /* actually, 16 bits, unaligned (!) */
  78. } tn3270e_header;
  79.  
  80. #define EH_SIZE 5
  81.